home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9520 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  47 lines

  1. Path: news.mty.itesm.mx!news
  2. From: Orlando Karam
  3. Newsgroups: comp.lang.c
  4. Subject: Re: *** NEED ADVICE : Shell out to DOS ***
  5. Date: Fri, 08 Mar 1996 19:24:36 GMT
  6. Organization: ITESM Campus Monterrey . DINF-DTCI
  7. Message-ID: <4hq1oo$2m6@news.mty.itesm.mx>
  8. References: <4hh220$bsv@fountain.mindlink.net>
  9. NNTP-Posting-Host: csline5.cieamer.conacyt.mx
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. mike_huwe@mindlink.bc.ca (Mike Huwe) wrote:
  13.  
  14. >I have a menu program. When the user selects option 1, the program should
  15. >shell out to dos and display the current version and then return back to
  16. >the menu.
  17.  
  18. >The code I used is: case '1':
  19. >                    system("ver");
  20. >                    break;
  21.  
  22. >This did not work. Is there more code that I must add or is it a different
  23. >command entirely? Thanks in advance.
  24.  
  25.  
  26. >Mike 
  27.  
  28.  
  29. I think the problem is that VER is an internal command,  so it can be
  30. 'executed' with system, you have to execute a copy of command.com, and
  31. then do it execute the command VER.
  32.  
  33. If you want to do it with a shell command, it should work :
  34. system("command /c ver")
  35.  
  36. (the /c parameter to command.com is for executing the command and then
  37. exit.)
  38.  
  39. There is also an interrupt service that gives you the version number,
  40. i don┤t have the reference now, but i believe that is a service of int
  41. 21h, so you can look on a list of interrupts and services.
  42.  
  43. Orlando.
  44.  
  45. P.D. Sprry for the english, i am mexican.
  46.  
  47.